﻿using ZilLion.Service.Core.Infrastructure.Base;

namespace ZilLion.Service.WeChatMallOss.Controllers
{
    public class WechatMallOssControllerBase : ZilLionControllerBase
    {
        /// <summary>
        ///     获取Token
        /// </summary>
        /// <returns></returns>
        protected long GetUserId()
        {
            object userid;
            return !GetJwtDictionary().TryGetValue("currentjwtuserid", out userid)
                ? 0
                : userid.ToInt64OrDefault(0);
        }


        /// <summary>
        ///     获取Token
        /// </summary>
        /// <returns></returns>
        protected string GetZlCompanyKey()
        {
            object zlcompanykey;
            return !GetJwtDictionary().TryGetValue("currentjwtzlcompanykey", out zlcompanykey)
                ? string.Empty
                : zlcompanykey.ToString();
        }
    }
}